﻿@model LearningMpaAbp.Tasks.Dtos.CreateTaskInput

@{
    ViewBag.Title = "Create";
}
<div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="createTask" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">Create Task</h4>
            </div>
            <div class="modal-body" id="modalContent">

                @using (Ajax.BeginForm("Create", "BackendTasks", new AjaxOptions()
                {
                    //UpdateTargetId = "tb_tasks",
                    //InsertionMode = InsertionMode.Replace,
                    OnBegin = "beginPost('#add')",
                    OnSuccess = "hideForm('#add')"
                }))
                {
                    @Html.AntiForgeryToken()
                    <div class="form-horizontal">
                        <h4>Task</h4>
                        <hr/>
                        @Html.ValidationSummary(true, "", new {@class = "text-danger"})
                        <div class="form-group">
                                @Html.LabelFor(model => model.AssignedPersonId, "AssignedPersonId", htmlAttributes: new { @class = "control-label col-md-2" })
                                <div class="col-md-10">
                                    @Html.DropDownList("AssignedPersonId", null, htmlAttributes: new { @class = "form-control" })
                                    @Html.ValidationMessageFor(model => model.AssignedPersonId, "", new { @class = "text-danger" })
                                </div>
                            </div>

                        <div class="form-group">
                            @Html.LabelFor(model => model.Title, htmlAttributes: new {@class = "control-label col-md-2"})
                            <div class="col-md-10">
                                @Html.EditorFor(model => model.Title, new {htmlAttributes = new {@class = "form-control"}})
                                @Html.ValidationMessageFor(model => model.Title, "", new {@class = "text-danger"})
                            </div>
                        </div>

                        <div class="form-group">
                            @Html.LabelFor(model => model.Description, htmlAttributes: new {@class = "control-label col-md-2"})
                            <div class="col-md-10">
                                @Html.EditorFor(model => model.Description, new {htmlAttributes = new {@class = "form-control"}})
                                @Html.ValidationMessageFor(model => model.Description, "", new {@class = "text-danger"})
                            </div>
                        </div>

                        <div class="form-group">
                            @Html.LabelFor(model => model.State, htmlAttributes: new {@class = "control-label col-md-2"})
                            <div class="col-md-10">
                                @Html.EnumDropDownListFor(model => model.State, htmlAttributes: new {@class = "form-control"})
                                @Html.ValidationMessageFor(model => model.State, "", new {@class = "text-danger"})
                            </div>
                        </div>


                        <div class="form-group">
                            <div class="col-md-offset-2 col-md-10">
                                <button type="submit" class="btn btn-default">Create</button>
                            </div>
                        </div>
                    </div>
                }


            </div>
        </div>
    </div>
</div>